/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entidades;

import java.io.Serializable;
import java.math.BigDecimal;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author George
 */
@Entity
@Table(name = "BOLETA", catalog = "BDACCELCOM", schema = "dbo")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Boleta.findAll", query = "SELECT b FROM Boleta b"),
    @NamedQuery(name = "Boleta.findByNroBoleta", query = "SELECT b FROM Boleta b WHERE b.nroBoleta = :nroBoleta"),
    @NamedQuery(name = "Boleta.findByMonto", query = "SELECT b FROM Boleta b WHERE b.monto = :monto")})
public class Boleta implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "NroBoleta")
    private String nroBoleta;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "Monto")
    private BigDecimal monto;
    @JoinColumn(name = "NroVenta", referencedColumnName = "NroVenta")
    @ManyToOne(optional = false)
    private Comprobante nroVenta;

    public Boleta() {
    }

    public Boleta(String nroBoleta) {
        this.nroBoleta = nroBoleta;
    }

    public String getNroBoleta() {
        return nroBoleta;
    }

    public void setNroBoleta(String nroBoleta) {
        this.nroBoleta = nroBoleta;
    }

    public BigDecimal getMonto() {
        return monto;
    }

    public void setMonto(BigDecimal monto) {
        this.monto = monto;
    }

    public Comprobante getNroVenta() {
        return nroVenta;
    }

    public void setNroVenta(Comprobante nroVenta) {
        this.nroVenta = nroVenta;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (nroBoleta != null ? nroBoleta.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Boleta)) {
            return false;
        }
        Boleta other = (Boleta) object;
        if ((this.nroBoleta == null && other.nroBoleta != null) || (this.nroBoleta != null && !this.nroBoleta.equals(other.nroBoleta))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entidades.Boleta[ nroBoleta=" + nroBoleta + " ]";
    }
    
}
